package puzzle.projecteuler.p100;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.net.URL;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;

public class Problem054 {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws IOException {
		
		String[] ds = readData();
		int c = 0;
		for (String d: ds) {
			if (compare(d) == 1) {
				c ++;
			}
		}
		System.out.println(c);
	}

	private static int compare(String d) {
		
		Card[][] players = split(d);
		
		return 0;
	}
	
	private static Card[][] split(String d) {
		String[] t = d.trim().split("\\s+");
		return new Card[][] {
				new Card[] {
						new Card(t[0]), new Card(t[1]), new Card(t[2]), new Card(t[3]), new Card(t[4])
				},
				new Card[] {
						new Card(t[5]), new Card(t[6]), new Card(t[7]), new Card(t[8]), new Card(t[9])
				}
		};
	}
	
	public static class Card {
		int value;
		char suit;
		
		public Card(int value, char suit) {
			this.value = value;
			this.suit = suit;
		}
		
		public Card(String card) {
			
			//value
			String t = card.substring(0, card.length()-1);
			int v = -1;
			if ("J".equalsIgnoreCase(t)) {
				v = 11;
			} else if ("Q".equalsIgnoreCase(t)) {
				v = 12;
			} else if ("K".equalsIgnoreCase(t)) {
				v = 13;
			} else if ("A".equalsIgnoreCase(t)) {
				v = 14;
			} else {
				v = Integer.valueOf(t);				
			}
			this.value = v;
			
			//suit
			this.suit = card.charAt(card.length()-1);
		}
		
		public static boolean isRoyalFlush(Card[] cards) {

			return false;
		}
	}

	public static String[] readData() throws IOException {

		URL url = Problem054.class.getResource("Problem054.txt");
		File file = new File(URLDecoder.decode(url.getPath(), "UTF-8"));

		BufferedReader br = new BufferedReader(new FileReader(file));
		String line = null;
		List<String> tmp = new ArrayList<String>();
		while ((line = br.readLine()) != null) {
			tmp.add(line);
		}
		br.close();
		return tmp.toArray(new String[tmp.size()]);
	}
}
